<?php

class validate_Authorise extends Zend_Validate_Abstract
    {
        const MSG_INVALID = 'invalid';
     
        protected $_messageTemplates = array(
            self::MSG_INVALID => "Die E-Mailadresse '%value%' ist bereits belegt."
        );
     
        public function isValid($value)
        {

        	$mapper = new Application_Model_Mapper_AuthMapper();
        	$mail = $mapper->fetchMail($value);

            $this->_setValue($value);
            if (!empty($mail)) {
                $this->_error(self::MSG_INVALID);
                return false;
            }
     
            return true;
            
        }
    }